home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: peer-news.britain.eu.net!uknet!owl-uk!news
- From: Kenn@owl-uk.co.uk (Ken Nicolson)
- Subject: Re: (HUGE) Help! This bug is killing me! Anyone have any ideas?
- Message-ID: <30f254ad.95008793@hector>
- Sender: news@owl-uk.co.uk (News system)
- Organization: Office Workstations Limited
- X-Newsreader: Forte Agent .99c/16.141
- References: <4cjmbt$gaf@maverick.tad.eds.com>
- Date: Tue, 9 Jan 1996 11:49:58 GMT
-
- fignet05.darrins@eds.com (Darrin Smith) wrote:
-
- >First off thanks for reading (sorry this is so HUGE) and helping me save my
- >sanity.
- >
-
- 862 lines! Give us a break!
-
- >Now, the following program seems to work perfectly until the final statement,
- >at which time Win95 reports that an execution of an invalid instruction has
- >been attenmpted, and that the program will be terminated.
- >
-
- >void main()
-
- Well, the program is free to crash if you declare main like that, I
- suppose, so the behaviour you are seeing could be consistent...
-
- > ccun_detail *detail;
- [snip!]
- > found=fread(detail,sizeof(ccun_detail),1,infile);
-
- No allocation of space for "detail". Go to the bottom of the class.
-
- >Well I've spent 3 days now trying to figure out what is wrong with this
-
- Three days you've spent? Are you sure you're in the right job?
- Crashing exiting a function is a sure sign that you've got a wayward
- pointer crapping on the stack. This took me two minutes to find,
- without even going near a C compiler.
-
- I could spend ages commenting on the nightmarish C/C++ hybrid coding,
- but I've got better things to do with my time.
-
- Ken
-